package com.springboot;

import java.util.HashSet;
import java.util.TreeSet;

public class test {
    String name;
    int age;
    test() {
        System.out.println("1");
        new HashSet();
new TreeSet<>();
    }


}

class a {
    public static void main(String[] args) {
        int[] arr = {11, 18, 25, 55, 78, 99, 105};
        int a = 107;
        int b=arr.length;
        int c=0;
        for (int i = 0; i <arr.length/2; i++) {
            if (a<arr[(c+b)/2]){
                b=(c+b)/2-1;

            }else if(a>arr[(c+b)/2]){
                c=(c+b)/2+1;
            }
            else if (a==arr[(c+b)/2]){
                System.out.println("您查找的索引为"+(c+b)/2);
                return;
            }
            else if((c==b)&(a!=arr[c])){
                System.out.println("查询不到");
                return;
            }
        }

    }


}